From: Georges Basile Stavracas Neto Date: Thu, 7 Jan 2021 13:05:18 +0000 (-0300) Subject: dash/dashIcon: Popup menu above the icon X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~583 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1e2532cf25197cc90720bd0267bbc9335fec6a0c;p=gnome-shell.git dash/dashIcon: Popup menu above the icon Now that the Dash is horizontal, the popup menu of the Dash icons must show up, instead of left/right. Make AppIcon.popupMenu() receive an optional parameter with the side to show the menu, using St.Side.LEFT as default. Override this method in DashIcon to always pass St.Side.TOP. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 4cfc13a7d..a2c6adaa0 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -2756,7 +2756,7 @@ var AppIcon = GObject.registerClass({ return this.app.get_id(); } - popupMenu() { + popupMenu(side = St.Side.LEFT) { this._removeMenuTimeout(); this.fake_release(); @@ -2764,7 +2764,7 @@ var AppIcon = GObject.registerClass({ this._draggable.fakeRelease(); if (!this._menu) { - this._menu = new AppIconMenu(this); + this._menu = new AppIconMenu(this, side); this._menu.connect('activate-window', (menu, window) => { this.activateWindow(window); }); @@ -2920,10 +2920,13 @@ var AppIcon = GObject.registerClass({ }); var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu { - constructor(source) { - let side = St.Side.LEFT; - if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) - side = St.Side.RIGHT; + constructor(source, side) { + if (Clutter.get_default_text_direction() === Clutter.TextDirection.RTL) { + if (side === St.Side.LEFT) + side = St.Side.RIGHT; + else if (side === St.Side.RIGHT) + side = St.Side.LEFT; + } super(source, 0.5, side); diff --git a/js/ui/dash.js b/js/ui/dash.js index 3d6e75623..9c8639b28 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -31,6 +31,10 @@ class DashIcon extends AppDisplay.AppIcon { }); } + popupMenu() { + super.popupMenu(St.Side.BOTTOM); + } + // Disable scale-n-fade methods used during DND by parent scaleAndFade() { }